/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SPARQL.PP;

import SPARQL.PropertyPath;
import java.util.Objects;

/**
 *
 * @author riccardo
 */
public class Closure extends PropertyPath{
    private PropertyPath p;

    public Closure(PropertyPath p) {
        this.p = p;
    }

    
    
    public PropertyPath getP() {
        return p;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 11 * hash + Objects.hashCode(this.p);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Closure other = (Closure) obj;
        if (!Objects.equals(this.p, other.p)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return p + "*";
    }

    @Override
    public Object clone(){
        return new Closure((PropertyPath) p.clone());
    }
    
}
